<template>
  <div>
    <a-modal
      v-model:visible="visible"
      :width="modalWidth"
      :title="modalTitle"
      @ok="handleOk"
      @cancel="handleCancel"
    >
      <slot />
    </a-modal>
  </div>
</template>
<script>
import { defineComponent, ref, computed } from "vue";

export default defineComponent({
  props: {
    modalTitle: {
      type: String,
      default: "標題",
    },
    visible: {
      type: Boolean,
      default: false,
    },
    modalWidth: {
      type: String,
      default: "550px",
    },
  },
  setup() {
    let fullName = computed(() => {
      get = () => {
        visible.value;
      };
    });

    const handleCancel = () => {
      this.$emit("handleCancel");
    };

    const handleOk = () => {
      this.$emit("submitData");
    };

    return {
      handleCancel,
      handleOk,
    };
  },
});
</script>
